import { Factory, Faker } from "@mikro-orm/seeder";
import { JobProjectSources } from "../entities/JobProjectSources";
import * as _ from "lodash";
import { title } from "./TitleGenerater";

export class SourcesFactory extends Factory<JobProjectSources> {
  model = JobProjectSources;

  definition(faker: Faker): Partial<JobProjectSources> {
    faker.setLocale('zh_CN')

    const name = `${faker.unique(faker.name.lastName)}${faker.name.firstName()}`
    const sex = faker.name.sex()

    return {
      createdAt: new Date(),
      updatedAt: new Date(),
      title : title()
    };
  }
}